package com.yycx.module.user.provider.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import com.yycx.common.mybatis.model.*;
import java.util.Map;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.RestController;
import com.yycx.common.springmvc.base.BaseController;
import com.yycx.module.user.client.entity.AppModule;
import com.yycx.module.user.provider.service.AppModuleService;
import springfox.documentation.annotations.ApiIgnore;


/**
 * APP模块定义控制器
 *
 * @author flyme
 * @date 2024-07-08
 */
@RestController
@RequestMapping("/module/")
public class AppModuleController extends BaseController<AppModuleService, AppModule>  {

    @ApiOperation(value = "APP模块定义-分页列表", notes = "APP模块定义分页列表")
    @GetMapping(value = "page")
    public ResultBody pageList(@RequestParam(required = false) Map params) {
        return bizService.pageList(params);
    }

    @ApiOperation(value = "APP模块定义-列表", notes = "APP模块定义列表")
    @GetMapping(value = "list")
    public ResultBody list(@RequestParam(required = false) Map params) {
        return bizService.listEntityMap(params);
    }

    @ApiOperation(value = "APP模块定义-添加", notes = "添加APP模块定义")
    @PostMapping(value = "save")
    public ResultBody save(@RequestParam(required = false) Map params) {
        return bizService.add(params);
    }

    @ApiOperation(value = "APP模块定义-更新", notes = "更新APP模块定义")
    @PostMapping(value = "update")
    public ResultBody update(@RequestParam(required = false) Map params) {
        return bizService.edit(params);
    }

    @ApiOperation(value = "APP模块定义-删除", notes = "删除APP模块定义")
    @PostMapping(value = "remove")
    public ResultBody remove(@RequestParam(required = false) Map params) {
        return bizService.delete(params);
    }


    @ApiOperation(value = "APP模块定义-详情", notes = "APP模块定义详情")
    @GetMapping(value = "get")
    public ResultBody get(@RequestParam(required = false) Map params) {
        return bizService.get(params);
    }
    /**
    * 导出APP模块定义统计
    *
    * @param params
    * @param request
    * @param response
    */
    @PostMapping(value = "export")
    public void export(@RequestParam(required = false) Map params, HttpServletRequest request, HttpServletResponse response) {
        bizService.export(params, request, response, "APP模块定义统计", "APP模块定义统计表");
    }

    @ApiOperation(value = "APP模块定义-发布状态", notes = "APP模块定义-发布状态")
    @PostMapping(value = "setStatus")
    public ResultBody setSendStatus(@RequestParam(required = false) Map map, @RequestParam(value = "state") Integer state) {
        return bizService.setState(map, "state", state);
    }

    @ApiOperation(value = "APP模块定义-上线状态", notes = "APP模块定义-上线状态")
    @PostMapping(value = "setOnLine")
    public ResultBody setOnLine(@RequestParam(required = false) Map map, @RequestParam(value = "onLine") Integer onLine) {
        return bizService.setState(map, "onLine", onLine);
    }

}
